// 导入组件
import Vue from 'vue';
import Router from 'vue-router';
// 登录
import login from '@/views/login';
// 首页
import index from '@/views/index';

import indexEchart from '@/views/myIndex/indexEchart';
/**
 * 基础菜单
 */
// 商品管理
import Goods from '@/views/goods/Goods';
// 机器信息管理
import Machine from '@/views/machine/Machine';
// 货道信息管理
import MachineAisle from '@/views/machine/MachineAisle';
/**
 * 订单管理
 */
// 交易订单
import Order from '@/views/pay/Order';
/**
 * 系统管理
 */
// 用户管理
import user from '@/views/system/user';
// 菜单管理
import Module from '@/views/system/Module';
// 角色管理
import Role from '@/views/system/Role';
// 公司管理
import Dept from '@/views/system/Dept';
// 系统环境变量
import Variable from '@/views/system/Variable';
// 权限管理
import Permission from '@/views/system/Permission';
/**
 * 支付管理
 */
// 支付配置信息
import MachineConfig from '@/views/machine/MachineConfig';
// 支付配置
import Config from '@/views/pay/Config';
/**
 * 数据监控
 */
// 监控查询
import druidLogin from '@/views/druid/login';

// 图表界面
import statistics from '@/views/charts/statistics';


// 疫情人员管理
// 确诊人员
import diagnosis from '@/views/census/diagnosis';
// 疑似人员
import suspected from '@/views/census/suspected';

// 疫情防控统计
// 排查人员信息
import checkInfo from '@/views/personManage/checkInfo';
// 隔离人员信息
import isolate from '@/views/personManage/isolate';
// 核酸检测
import nucleicAcidTesting from '@/views/personManage/nucleicAcidTesting';

// 疫情工作管理
// 物资
import material from '@/views/workManage/material';
// 工作人员
import worker from '@/views/workManage/worker';

// 社区疫情防控
// 社区信息管理
import InfoManage from '@/views/communityPrevention/InfoManage';
// 社区防控管理
import residentManage from '@/views/communityPrevention/residentManage';

// 学校疫情防控
// 学校信息管理
import schoolInfoManage from '@/views/schoolPrevention/schoolInfoManage';
// 学生信息管理
import studentInfoManage from '@/views/schoolPrevention/studentInfoManage';
// 学校防控管理
import everyDayCheck from '@/views/schoolPrevention/everyDayCheck';

// 单位疫情防控
// 入驻单位管理
import settleInCompany from '@/views/companyPrevention/settleInCompany';
// 单位人员管理
import unitPersonManage from '@/views/companyPrevention/unitPersonManage';
// 企业防控管理
import access from '@/views/companyPrevention/access';

// 启用路由
Vue.use(Router);

// 导出路由 
export default new Router({
    // mode: 'history',
    routes: [
        {
            path: '/',
            name: '',
            component: login,
            hidden: true,
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/login',
            name: '登录',
            component: login,
            hidden: true,
            meta: {
                requireAuth: false
            }
        },
        {
            path: '/index',
            name: '',
            component: index,
            iconCls: 'icon-shouye',
            children: [
                {
                    path: '/myIndex/indexEchart',
                    name: '首页',
                    component: indexEchart,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/census/diagnosis',
                    name: '确诊人员',
                    component: diagnosis,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/census/suspected',
                    name: '疑似病例',
                    component: suspected,
                    meta: {
                        requireAuth: true
                    }
                },

                // {
                //     path: '/goods/Goods',
                //     name: '排查人员信息',
                //     component: Goods,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, 
                {
                    path: '/personManage/checkInfo',
                    name: '排查人员信息',
                    component: checkInfo,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/personManage/isolate',
                    name: '隔离人员信息',
                    component: isolate,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/personManage/nucleicAcidTesting',
                    name: '核酸检测',
                    component: nucleicAcidTesting,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/workManage/material',
                    name: '物资',
                    component: material,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/workManage/worker',
                    name: '疫情工作人员',
                    component: worker,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/communityPrevention/InfoManage',
                    name: '社区信息管理',
                    component: InfoManage,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/communityPrevention/residentManage',
                    name: '社区防控管理',
                    component: residentManage,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/schoolPrevention/schoolInfoManage',
                    name: '学校信息管理',
                    component: schoolInfoManage,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/schoolPrevention/studentInfoManage',
                    name: '学生信息管理',
                    component: studentInfoManage,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/schoolPrevention/everyDayCheck',
                    name: '学校防控管理',
                    component: everyDayCheck,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/companyPrevention/settleInCompany',
                    name: '入驻单位管理',
                    component: settleInCompany,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/companyPrevention/unitPersonManage',
                    name: '单位人员管理',
                    component: unitPersonManage,
                    meta: {
                        requireAuth: true
                    }
                },
                {
                    path: '/companyPrevention/access',
                    name: '企业防控管理',
                    component: access,
                    meta: {
                        requireAuth: true
                    }
                },



                // {
                //     path: '/machine/Machine',
                //     name: '机器信息管理',
                //     component: Machine,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, {
                //     path: '/machine/MachineAisle',
                //     name: '货道信息管理',
                //     component: MachineAisle,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, {
                //     path: '/pay/Order',
                //     name: '交易订单',
                //     component: Order,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, 
                {
                    path: '/system/user',
                    name: '用户管理',
                    component: user,
                    meta: {
                        requireAuth: true
                    }
                }, 
                // {
                //     path: '/system/Module',
                //     name: '菜单管理',
                //     component: Module,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, 
                {
                    path: '/system/Role',
                    name: '角色管理',
                    component: Role,
                    meta: {
                        requireAuth: true
                    }
                }, 
                // {
                //     path: '/system/Dept',
                //     name: '公司管理',
                //     component: Dept,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, 
                // {
                //     path: '/system/Variable',
                //     name: '系统环境变量',
                //     component: Variable,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, 
                {
                    path: '/system/Permission',
                    name: '权限管理',
                    component: Permission,
                    meta: {
                        requireAuth: true
                    }
                }, 
                // {
                //     path: '/machine/MachineConfig',
                //     name: '支付配置信息',
                //     component: MachineConfig,
                //     meta: {
                //         requireAuth: true
                //     }
                // }, 
                // {
                //     path: '/pay/Config',
                //     name: '支付配置',
                //     component: Config,
                //     meta: {
                //         requireAuth: true
                //     }
                // },
                //  {
                //     path: '/druid/login',
                //     name: '监控查询',
                //     component: druidLogin,
                //     meta: {
                //         requireAuth: true
                //     }
                // },
                //  {
                //     path: '/charts/statistics',
                //     name: '数据可视化',
                //     component: statistics,
                //     meta: {
                //         requireAuth: true
                //     }
                // }
            ]
        },
    ]
})
// const originalPush = Router.prototype.push
// Router.prototype.push = function push(location, onResolve, onReject) {
//     if (onResolve || onReject) return originalPush.call(this, location, onResolve, onReject)
//     return originalPush.call(this, location).catch(err => err)
// }
